	<div class="container-fluid" style="margin: 0px 15px 0px 15px;">
			
			<fieldset class="cad">
				<legend>Solicitar Alteração de Ramal</legend>
				<form class="form-horizontal" role="form" id="form">
					
					<div class="form-group">
						<label for="" class="col-sm-2 control-label">Nome</label>
						<div class="col-sm-3">
							<input type="text" id="contato" name="contato" value=""  class="form-control input-sm"  placeholder="Digite seu nome">
						</div>
					</div>
					<div class="form-group">
						<label for="" class="col-sm-2 control-label">Ramal</label>
						<div class="col-sm-2">
							<input type="text" id="ramal"  name="ramal" value="" class="form-control input-sm" id="" placeholder="Digite o seu ramal">
							<input type="hidden" id="idramal" name="idramal" value="" class="form-control input-sm" />
						</div>
					</div>
					<div class="form-group">
						<label for="" class="col-sm-2 control-label">E-mail</label>
						<div class="col-sm-3">
							<input type="email" id="email" name="email" value=""  class="form-control input-sm"  placeholder="Digite o seu e-mail">
						</div>
					</div>
					<div class="form-group">
						<label for="inputEmail3" class="col-sm-2 control-label">Justificativa</label>
						<div class="col-sm-4">
						  <textarea class="form-control input-sm" id="justificativa" name="justificativa"  placeholder="Descreva seu pedido" rows="5"></textarea>
						</div>
					  </div>
					<div class="form-group">
					</div>
					<div class="form-group">
							<div class="col-sm-offset-2 col-sm-10">
							<?php 
								$data = array('name'=>'salvar','type' => 'submit','class' => 'btn btn-primary','content' =>'Enviar');
								echo form_button($data);
							?>
							<a id="cancelar" href="<?php echo base_url('index.php/inicio');?>" class="btn btn-default"></span>Cancelar</a>
							</div>
					</div>
				</form>
			</fieldset>
			
	</div>
	<script language="javascript" type="text/javascript">
	$(document).ready(function(){
		$("#contato").focus();
		$("#ramal").mask('(99) 9999-9999');
		
		$('#form').validate({  
			rules: {  
				ramal: { required: true },
				contato: {
						required:true,
						remote : {
							url : '<?php echo base_url('index.php/contatos/valida');?>',
							type : 'get',
							data : {
								'contato':function(){
									return $('#contato').val();},
								'idramal': function(){
									return $('#idramal').val();}
							}
							
						},
				},
				cargo: { required: true }
				
			},  
			messages: {  
				ramal: { required: 'Preencha o campo'},
				contato: { required: 'Preencha o campo', remote: ' Contato já cadastrado neste ramal!'},
				cargo: { required: 'Preencha o campo'}
			},
			submitHandler: function( form ){  
				var dados = $( form ).serialize();  
				$.ajax({  
					type: "POST",  
					url: "<?php echo base_url('index.php/contatos/salvar');?>",  
					data: dados,  
					success: function( data )  
					{  
						alertify.alert( data );
						$("#contato").val('');
						$("#cargo").val('');
						$("#cargo").val('');
						$("#tag").val('');
						$("#contato").focus();
					}  
				});  
				return false;  
			} 
		}); 
	});
		
	</script>
	</body>
</html>